package controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dao.Events;

import model.EventModel;

public class ManageEvents {
	private static final long serialVersionUID = 1L;
	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
								throws ServletException, IOException{
		List<EventModel> events = new ArrayList<EventModel>();
		Events eventDTO = new Events();
		events = eventDTO.ListEvents();
		request.setAttribute("events",events);
		request.getRequestDispatcher("events.jsp").forward(request, response);
//		RequestDispatcher dispatcher =
//			request.getRequestDispatcher
//			("products.jsp");
//			dispatcher.forward(request, response);
	}
	


}
